import React, { Component, Fragment } from 'react'
import { Button } from 'antd'

export default class Dialog extends Component {
    state = {
        flag: false
    }
    render() {
        const { flag } = this.state
        const { children } = this.props
        return (
            <div>
                <Button onClick = {() => {
                    this.setState({
                        flag: !this.state.flag
                    })
                }} type="primary">点我出现弹框</Button>

                <div className = { flag? 'block': 'none' }>
                    <div className ="box">
                        { children }
                    </div>
                </div>
                
            </div>
        )
    }
}
